<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 人员管理控制器
 */
class Person extends AdminBase
{
    
    /**
     * 人员列表
     */
    public function personList()
    {
        
        $this->assign('list', $this->logicPerson->getPersonList());
        
        return $this->fetch('person_list');
    }
    
    /**
     * 人员添加
     */
    public function personAdd()
    {
        
        IS_POST && $this->jump($this->logicPerson->personEdit($this->param));
        
        return $this->fetch('person_edit');
    }
    
    /**
     * 人员编辑
     */
    public function personEdit()
    {
        
        IS_POST && $this->jump($this->logicPerson->personEdit($this->param));
        
        $info = $this->logicPerson->getPersonInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('person_edit');
    }
    
    /**
     * 人员删除
     */
    public function personDel($id = 0)
    {
        
        $this->jump($this->logicPerson->personDel(['id' => $id]));
    }
    /**
     * 人员导出
     */
    public function exportPersonList()
    {
        
        $where = $this->logicPerson->getWhere($this->param);
        
        $this->logicPerson->exportPersonList($where);
    }
    
}
